package com.kmist.xiakexing.utils;

import android.os.Build;
import android.text.Html;
import android.text.Spanned;

public class Color {
    public final static String ESC = "<font color=\"";
    public final static String ESC_END = "\">";
    public final static String NOR = "</font>";
    public final static String ENDL = "<br>";
    public final static String RED = ESC + "#FF0000" + ESC_END; //RED
    public final static String HIW = ESC + "#FFFFFF" + ESC_END; //WHITE
    public final static String HIG = ESC + "#00FF00" + ESC_END; //GREEN
    public final static String HIY = ESC + "#FFFF00" + ESC_END; //YELLOW
    public final static String MAG = ESC + "#FF0090" + ESC_END; //Magenta
    public final static String CYN = ESC + "#00FFFF" + ESC_END; //Magenta

    public final static String YEL = ESC + "#FFFF00" + ESC_END; //YELLOW

    public final static Spanned STR(String str){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            return Html.fromHtml(str, Html.FROM_HTML_MODE_LEGACY);
        }else{
            return Html.fromHtml(str);
        }
    }
}
